<template>
<div class="user">
    <div class="personal">
        <div class="avatar-and-edit">
            <div class="avatar" :style="{ backgroundImage: userStore.userInfo.avatar ? `url(${userStore.userInfo.avatar})` : 'none' }"></div>
            <div class="edit-text">编辑资料</div>
        </div>
        <div class="nickname-and-vip">
            <div class="nickname">{{ userStore.userInfo.nickname || '昵称' }}</div>
            <div class="vip-expire">vip到期时间: {{ userStore.userInfo.vip_expire_time || '1970-1-1' }}</div>
        </div>
    </div>
</div>
</template>

<script setup lang="ts">
import { useUserStore } from '@/stores/user';
const userStore = useUserStore();
</script>

<style scoped>
.user {
    width: 1514px;
    min-width: 1500px;
    max-width: 1514px;
    height: 300px;
    background-color:  #404040;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    position: relative;
    left: -50px;
    overflow: visible;
}

.personal {
    margin-left: 150px;
    padding-top: 50px;
}

.avatar-and-edit {
    width: 300px;
    height: 300px;
    background: linear-gradient(to bottom, red 250px, rgb(200, 0, 0) 250px);
    float: left;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.avatar {
    width: 150px;
    height: 150px;
    background-color: #ccc;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
}

.nickname-and-vip {
    width: 900px;
    height: 300px;
    background: linear-gradient(to bottom, white 250px, rgb(200, 200, 200) 250px);
    float: left;
}

.edit-text {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.nickname {
    padding: 30px;
    margin-top: 70px;
    margin-left: 50px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.vip-expire {
    padding: 0 30px;
    margin-left: 50px;
    font-size: 16px;
    color: #666;
}
</style>